package com.dropdb.demo.controller.admin;

import com.dropdb.demo.bean.Address;
import com.dropdb.demo.bean.User;
import com.dropdb.demo.bean.bo.BaseData;
import com.dropdb.demo.bean.vo.BaseRespVO;
import com.dropdb.demo.service.AddressService;
import com.dropdb.demo.service.UserService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author:tanxin Desc:
 * @date:2020/6/26 19:47
 */
@RestController
@RequestMapping("/admin/address")
public class AdminAddressController {

    @Resource
    AddressService addressService;
    @RequestMapping("/list")
    @RequiresPermissions(value = {"*", "admin:address:list"}, logical = Logical.OR)
    public BaseRespVO queryAddress(Integer page,Integer limit,String sort,String order,Integer userId,String name){
        BaseData baseData = addressService.queryAddress(page,limit,sort,order,userId,name);
        return BaseRespVO.ok(baseData);
    }
}
